
import 'dart:convert';

SubscriptionToken subscriptionTokenFromJson(String str) => SubscriptionToken.fromJson(json.decode(str));

String subscriptionTokenToJson(SubscriptionToken data) => json.encode(data.toJson());

class SubscriptionToken {
    SubscriptionToken({
        this.clientToken,
        this.success,
        this.customerId,
        this.customer,
    });

    String? clientToken;
    bool? success;
    String? customerId;
    Customer? customer;

    factory SubscriptionToken.fromJson(Map<String, dynamic> json) => SubscriptionToken(
        clientToken: json["clientToken"],
        success: json["success"],
        customerId: json["customerId"],
        customer: json["customer"]!=null ? Customer.fromJson(json["customer"]): null,
    );

    Map<String, dynamic> toJson() => {
        "clientToken": clientToken,
        "success": success,
        "customerId": customerId,
        "customer": customer?.toJson(),
    };
}

class Transaction {
    Transaction({
        this.addOns,
        this.amount,
        this.avsErrorResponseCode,
        this.avsPostalCodeResponseCode,
        this.avsStreetAddressResponseCode,
        this.billingAddress,
        this.channel,
        this.createdAt,
        this.creditCard,
        this.currencyIsoCode,
        this.customer,
        this.customFields,
        this.cvvResponseCode,
        this.disbursementDetails,
        this.disputes,
        this.descriptor,
        this.discounts,
        this.escrowStatus,
        this.gatewayRejectionReason,
        this.id,
        this.merchantAccountId,
        this.orderId,
        this.applePayDetails,
        this.androidPayDetails,
        this.amexExpressCheckoutDetails,
        this.venmoAccountDetails,
        this.planId,
        this.processorAuthorizationCode,
        this.processorResponseCode,
        this.processorResponseText,
        this.processorSettlementResponseCode,
        this.processorSettlementResponseText,
        this.additionalProcessorResponse,
        this.voiceReferralNumber,
        this.purchaseOrderNumber,
        this.recurring,
        this.refundedTransactionId,
        this.refundId,
        this.refundIds,
        this.settlementBatchId,
        this.shippingAddress,
        this.status,
        this.statusHistory,
        this.subscriptionId,
        this.subscription,
        this.taxAmount,
        this.taxExempt,
        this.type,
        this.updatedAt,
        this.serviceFeeAmount,
        this.paymentInstrumentType,
        this.riskData,
        this.threeDSecureInfo,
        this.coinbaseDetails,
        this.authorizedTransactionId,
        this.partialSettlementTransactionIds,
        this.disbursed,
        this.payPalDetails,
    });

    List<dynamic>? addOns;
    double? amount;
    String? avsErrorResponseCode;
    dynamic avsPostalCodeResponseCode;
    dynamic avsStreetAddressResponseCode;
    Address? billingAddress;
    dynamic channel;
    int? createdAt;
    CreditCard? creditCard;
    dynamic currencyIsoCode;
    Customer? customer;
    CustomFields? customFields;
    dynamic cvvResponseCode;
    DisbursementDetails? disbursementDetails;
    List<dynamic>? disputes;
    Descriptor? descriptor;
    List<dynamic>? discounts;
    dynamic escrowStatus;
    dynamic gatewayRejectionReason;
    String? id;
    dynamic merchantAccountId;
    dynamic orderId;
    dynamic applePayDetails;
    dynamic androidPayDetails;
    dynamic amexExpressCheckoutDetails;
    dynamic venmoAccountDetails;
    dynamic planId;
    String? processorAuthorizationCode;
    String? processorResponseCode;
    dynamic processorResponseText;
    String? processorSettlementResponseCode;
    String? processorSettlementResponseText;
    dynamic additionalProcessorResponse;
    dynamic voiceReferralNumber;
    dynamic purchaseOrderNumber;
    bool? recurring;
    dynamic refundedTransactionId;
    dynamic refundId;
    List<dynamic>? refundIds;
    String? settlementBatchId;
    Address? shippingAddress;
    dynamic status;
    List<TransactionStatusHistory>? statusHistory;
    dynamic subscriptionId;
    Subscription? subscription;
    dynamic taxAmount;
    bool? taxExempt;
    Type? type;
    int? updatedAt;
    dynamic serviceFeeAmount;
    dynamic paymentInstrumentType;
    dynamic riskData;
    dynamic threeDSecureInfo;
    dynamic coinbaseDetails;
    dynamic authorizedTransactionId;
    List<dynamic>? partialSettlementTransactionIds;
    bool? disbursed;
    dynamic payPalDetails;

    factory Transaction.fromJson(Map<String, dynamic> json) => Transaction(
        addOns: List<dynamic>.from(json["addOns"].map((x) => x)),
        amount: json["amount"].toDouble(),
        avsErrorResponseCode: json["avsErrorResponseCode"] == null ? null : json["avsErrorResponseCode"],
        avsPostalCodeResponseCode: json["avsPostalCodeResponseCode"],
        avsStreetAddressResponseCode: json["avsStreetAddressResponseCode"],
        billingAddress: Address.fromJson(json["billingAddress"]),
        channel: json["channel"],
        createdAt: json["createdAt"],
        creditCard: CreditCard.fromJson(json["creditCard"]),
        currencyIsoCode: json["currencyIsoCode"],
        customer: Customer.fromJson(json["customer"]),
        customFields: CustomFields.fromJson(json["customFields"]),
        cvvResponseCode: json["cvvResponseCode"],
        disbursementDetails: DisbursementDetails.fromJson(json["disbursementDetails"]),
        disputes: List<dynamic>.from(json["disputes"].map((x) => x)),
        descriptor: Descriptor.fromJson(json["descriptor"]),
        discounts: List<dynamic>.from(json["discounts"].map((x) => x)),
        escrowStatus: json["escrowStatus"],
        gatewayRejectionReason: json["gatewayRejectionReason"],
        id: json["id"],
        merchantAccountId: json["merchantAccountId"],
        orderId: json["orderId"],
        applePayDetails: json["applePayDetails"],
        androidPayDetails: json["androidPayDetails"],
        amexExpressCheckoutDetails: json["amexExpressCheckoutDetails"],
        venmoAccountDetails: json["venmoAccountDetails"],
        planId: json["planId"],
        processorAuthorizationCode: json["processorAuthorizationCode"],
        processorResponseCode: json["processorResponseCode"],
        processorResponseText: json["processorResponseText"],
        processorSettlementResponseCode: json["processorSettlementResponseCode"],
        processorSettlementResponseText: json["processorSettlementResponseText"],
        additionalProcessorResponse: json["additionalProcessorResponse"],
        voiceReferralNumber: json["voiceReferralNumber"],
        purchaseOrderNumber: json["purchaseOrderNumber"],
        recurring: json["recurring"],
        refundedTransactionId: json["refundedTransactionId"],
        refundId: json["refundId"],
        refundIds: List<dynamic>.from(json["refundIds"].map((x) => x)),
        settlementBatchId: json["settlementBatchId"],
        shippingAddress: Address.fromJson(json["shippingAddress"]),
        status: json["status"],
        statusHistory: List<TransactionStatusHistory>.from(json["statusHistory"].map((x) => TransactionStatusHistory.fromJson(x))),
        subscriptionId: json["subscriptionId"],
        subscription: Subscription.fromJson(json["subscription"]),
        taxAmount: json["taxAmount"],
        taxExempt: json["taxExempt"],
        type: json["type"],
        updatedAt: json["updatedAt"],
        serviceFeeAmount: json["serviceFeeAmount"],
        paymentInstrumentType: json["paymentInstrumentType"],
        riskData: json["riskData"],
        threeDSecureInfo: json["threeDSecureInfo"],
        coinbaseDetails: json["coinbaseDetails"],
        authorizedTransactionId: json["authorizedTransactionId"],
        partialSettlementTransactionIds: List<dynamic>.from(json["partialSettlementTransactionIds"].map((x) => x)),
        disbursed: json["disbursed"],
        payPalDetails: json["payPalDetails"],
    );

    Map<String, dynamic> toJson() => {
        "addOns": List<dynamic>.from(addOns!.map((x) => x)),
        "amount": amount,
        "avsErrorResponseCode": avsErrorResponseCode == null ? null : avsErrorResponseCode,
        "avsPostalCodeResponseCode": avsPostalCodeResponseCode,
        "avsStreetAddressResponseCode": avsStreetAddressResponseCode,
        "billingAddress": billingAddress?.toJson(),
        "channel": channel,
        "createdAt": createdAt,
        "creditCard": creditCard?.toJson(),
        "currencyIsoCode": currencyIsoCode,
        "customer": customer?.toJson(),
        "customFields": customFields?.toJson(),
        "cvvResponseCode": cvvResponseCode,
        "disbursementDetails": disbursementDetails?.toJson(),
        "disputes": List<dynamic>.from(disputes!.map((x) => x)),
        "descriptor": descriptor?.toJson(),
        "discounts": List<dynamic>.from(discounts!.map((x) => x)),
        "escrowStatus": escrowStatus,
        "gatewayRejectionReason": gatewayRejectionReason,
        "id": id,
        "merchantAccountId": merchantAccountId,
        "orderId": orderId,
        "applePayDetails": applePayDetails,
        "androidPayDetails": androidPayDetails,
        "amexExpressCheckoutDetails": amexExpressCheckoutDetails,
        "venmoAccountDetails": venmoAccountDetails,
        "planId":planId,
        "processorAuthorizationCode": processorAuthorizationCode,
        "processorResponseCode": processorResponseCode,
        "processorResponseText": processorResponseText,
        "processorSettlementResponseCode": processorSettlementResponseCode,
        "processorSettlementResponseText": processorSettlementResponseText,
        "additionalProcessorResponse": additionalProcessorResponse,
        "voiceReferralNumber": voiceReferralNumber,
        "purchaseOrderNumber": purchaseOrderNumber,
        "recurring": recurring,
        "refundedTransactionId": refundedTransactionId,
        "refundId": refundId,
        "refundIds": List<dynamic>.from(refundIds!.map((x) => x)),
        "settlementBatchId": settlementBatchId,
        "shippingAddress": shippingAddress?.toJson(),
        "status": status,
        "statusHistory": List<dynamic>.from(statusHistory!.map((x) => x.toJson())),
        "subscriptionId": subscriptionId,
        "subscription": subscription?.toJson(),
        "taxAmount": taxAmount,
        "taxExempt": taxExempt,
        "type": type,
        "updatedAt": updatedAt,
        "serviceFeeAmount": serviceFeeAmount,
        "paymentInstrumentType": paymentInstrumentType,
        "riskData": riskData,
        "threeDSecureInfo": threeDSecureInfo,
        "coinbaseDetails": coinbaseDetails,
        "authorizedTransactionId": authorizedTransactionId,
        "partialSettlementTransactionIds": List<dynamic>.from(partialSettlementTransactionIds!.map((x) => x)),
        "disbursed": disbursed,
        "payPalDetails": payPalDetails,
    };
}

class Subscription {
    Subscription({
        this.addOns,
        this.balance,
        this.billingDayOfMonth,
        this.billingPeriodEndDate,
        this.billingPeriodStartDate,
        this.currentBillingCycle,
        this.daysPastDue,
        this.descriptor,
        this.discounts,
        this.failureCount,
        this.createdAt,
        this.updatedAt,
        this.firstBillingDate,
        this.id,
        this.merchantAccountId,
        this.nextBillAmount,
        this.nextBillingDate,
        this.nextBillingPeriodAmount,
        this.numberOfBillingCycles,
        this.paidThroughDate,
        this.paymentMethodToken,
        this.planId,
        this.price,
        this.status,
        this.statusHistory,
        this.transactions,
        this.trialDuration,
        this.trialDurationUnit,
    });

    List<dynamic>? addOns;
    int? balance;
    int? billingDayOfMonth;
    int? billingPeriodEndDate;
    int? billingPeriodStartDate;
    int? currentBillingCycle;
    dynamic daysPastDue;
    Descriptor? descriptor;
    List<dynamic>? discounts;
    int? failureCount;
    int? createdAt;
    int? updatedAt;
    int? firstBillingDate;
    dynamic id;
    dynamic merchantAccountId;
    double? nextBillAmount;
    int? nextBillingDate;
    double? nextBillingPeriodAmount;
    dynamic numberOfBillingCycles;
    int? paidThroughDate;
    String? paymentMethodToken;
   dynamic planId;
    double? price;
    dynamic status;
    List<SubscriptionStatusHistory>? statusHistory;
    List<Transaction>? transactions;
    dynamic trialDuration;
    dynamic trialDurationUnit;

    factory Subscription.fromJson(Map<String, dynamic> json) => Subscription(
        addOns: List<dynamic>.from(json["addOns"].map((x) => x)),
        balance: json["balance"] == null ? null : json["balance"],
        billingDayOfMonth: json["billingDayOfMonth"] == null ? null : json["billingDayOfMonth"],
        billingPeriodEndDate: json["billingPeriodEndDate"],
        billingPeriodStartDate: json["billingPeriodStartDate"],
        currentBillingCycle: json["currentBillingCycle"] == null ? null : json["currentBillingCycle"],
        daysPastDue: json["daysPastDue"],
        descriptor: json["descriptor"] == null ? null : Descriptor.fromJson(json["descriptor"]),
        discounts: List<dynamic>.from(json["discounts"].map((x) => x)),
        failureCount: json["failureCount"] == null ? null : json["failureCount"],
        createdAt: json["createdAt"] == null ? null : json["createdAt"],
        updatedAt: json["updatedAt"] == null ? null : json["updatedAt"],
        firstBillingDate: json["firstBillingDate"] == null ? null : json["firstBillingDate"],
        id: json["id"] == null ? null : json["id"],
        merchantAccountId: json["merchantAccountId"] == null ? null : json["merchantAccountId"],
        nextBillAmount: json["nextBillAmount"] == null ? null : json["nextBillAmount"].toDouble(),
        nextBillingDate: json["nextBillingDate"] == null ? null : json["nextBillingDate"],
        nextBillingPeriodAmount: json["nextBillingPeriodAmount"] == null ? null : json["nextBillingPeriodAmount"].toDouble(),
        numberOfBillingCycles: json["numberOfBillingCycles"],
        paidThroughDate: json["paidThroughDate"] == null ? null : json["paidThroughDate"],
        paymentMethodToken: json["paymentMethodToken"] == null ? null : json["paymentMethodToken"],
        planId: json["planId"] == null ? null : json["planId"],
        price: json["price"] == null ? null : json["price"].toDouble(),
        status: json["status"] == null ? null : json["status"],
        statusHistory: List<SubscriptionStatusHistory>.from(json["statusHistory"].map((x) => SubscriptionStatusHistory.fromJson(x))),
        transactions: List<Transaction>.from(json["transactions"].map((x) => Transaction.fromJson(x))),
        trialDuration: json["trialDuration"],
        trialDurationUnit: json["trialDurationUnit"],
    );

    Map<String, dynamic> toJson() => {
        "addOns": List<dynamic>.from(addOns!.map((x) => x)),
        "balance": balance == null ? null : balance,
        "billingDayOfMonth": billingDayOfMonth == null ? null : billingDayOfMonth,
        "billingPeriodEndDate": billingPeriodEndDate,
        "billingPeriodStartDate": billingPeriodStartDate,
        "currentBillingCycle": currentBillingCycle == null ? null : currentBillingCycle,
        "daysPastDue": daysPastDue,
        "descriptor": descriptor == null ? null : descriptor?.toJson(),
        "discounts": List<dynamic>.from(discounts!.map((x) => x)),
        "failureCount": failureCount == null ? null : failureCount,
        "createdAt": createdAt == null ? null : createdAt,
        "updatedAt": updatedAt == null ? null : updatedAt,
        "firstBillingDate": firstBillingDate == null ? null : firstBillingDate,
        "id": id == null ? null : id,
        "merchantAccountId": merchantAccountId == null ? null : merchantAccountId,
        "nextBillAmount": nextBillAmount == null ? null : nextBillAmount,
        "nextBillingDate": nextBillingDate == null ? null : nextBillingDate,
        "nextBillingPeriodAmount": nextBillingPeriodAmount == null ? null : nextBillingPeriodAmount,
        "numberOfBillingCycles": numberOfBillingCycles,
        "paidThroughDate": paidThroughDate == null ? null : paidThroughDate,
        "paymentMethodToken": paymentMethodToken == null ? null : paymentMethodToken,
        "planId": planId == null ? null : planId,
        "price": price == null ? null : price,
        "status": status == null ? null : status,
        "statusHistory": List<dynamic>.from(statusHistory!.map((x) => x.toJson())),
        "transactions": List<dynamic>.from(transactions!.map((x) => x.toJson())),
        "trialDuration": trialDuration,
        "trialDurationUnit": trialDurationUnit,
    };
}

class CreditCard {
    CreditCard({
        this.billingAddress,
        this.bin,
        this.cardholderName,
        this.cardType,
        this.createdAt,
        this.customerId,
        this.customerLocation,
        this.expirationMonth,
        this.expirationYear,
        this.imageUrl,
        this.last4,
        this.commercial,
        this.debit,
        this.durbinRegulated,
        this.healthcare,
        this.payroll,
        this.prepaid,
        this.countryOfIssuance,
        this.issuingBank,
        this.uniqueNumberIdentifier,
        this.subscriptions,
        this.token,
        this.updatedAt,
        this.verification,
        this.expirationDate,
        this.venmoSdk,
        this.maskedNumber,
        this.expired,
        this.creditCardDefault,
    });

    Address? billingAddress;
    String? bin;
    dynamic cardholderName;
    dynamic cardType;
    int? createdAt;
    String? customerId;
    dynamic customerLocation;
    String? expirationMonth;
    String? expirationYear;
    String? imageUrl;
    String? last4;
    dynamic commercial;
    dynamic debit;
    dynamic durbinRegulated;
    dynamic healthcare;
    dynamic payroll;
    dynamic prepaid;
    dynamic countryOfIssuance;
    dynamic issuingBank;
    String? uniqueNumberIdentifier;
    List<Subscription>? subscriptions;
    String? token;
    int? updatedAt;
    dynamic verification;
    dynamic expirationDate;
    bool? venmoSdk;
    String? maskedNumber;
    bool? expired;
    bool? creditCardDefault;

    factory CreditCard.fromJson(Map<String, dynamic> json) => CreditCard(
        billingAddress: json["billingAddress"] == null ? null : Address.fromJson(json["billingAddress"]),
        bin: json["bin"],
        cardholderName: json["cardholderName"],
        cardType: json["cardType"],
        createdAt: json["createdAt"] == null ? null : json["createdAt"],
        customerId: json["customerId"] == null ? null : json["customerId"],
        customerLocation: json["customerLocation"],
        expirationMonth: json["expirationMonth"],
        expirationYear: json["expirationYear"],
        imageUrl: json["imageUrl"],
        last4: json["last4"],
        commercial: json["commercial"],
        debit: json["debit"],
        durbinRegulated: json["durbinRegulated"],
        healthcare:json["healthcare"],
        payroll: json["payroll"],
        prepaid: json["prepaid"],
        countryOfIssuance: json["countryOfIssuance"],
        issuingBank: json["issuingBank"],
        uniqueNumberIdentifier: json["uniqueNumberIdentifier"],
        subscriptions: List<Subscription>.from(json["subscriptions"].map((x) => Subscription.fromJson(x))),
        token: json["token"],
        updatedAt: json["updatedAt"] == null ? null : json["updatedAt"],
        verification: json["verification"],
        expirationDate: json["expirationDate"],
        venmoSdk: json["venmoSdk"],
        maskedNumber: json["maskedNumber"],
        expired: json["expired"],
        creditCardDefault: json["default"],
    );

    Map<String, dynamic> toJson() => {
        "billingAddress": billingAddress == null ? null : billingAddress?.toJson(),
        "bin": bin,
        "cardholderName": cardholderName,
        "cardType": cardType,
        "createdAt": createdAt == null ? null : createdAt,
        "customerId": customerId == null ? null : customerId,
        "customerLocation": customerLocation,
        "expirationMonth": expirationMonth,
        "expirationYear": expirationYear,
        "imageUrl": imageUrl,
        "last4": last4,
        "commercial": commercial,
        "debit":debit,
        "durbinRegulated": durbinRegulated,
        "healthcare": healthcare,
        "payroll": payroll,
        "prepaid": prepaid,
        "countryOfIssuance": countryOfIssuance,
        "issuingBank": issuingBank,
        "uniqueNumberIdentifier": uniqueNumberIdentifier,
        "subscriptions": List<dynamic>.from(subscriptions!.map((x) => x.toJson())),
        "token": token,
        "updatedAt": updatedAt == null ? null : updatedAt,
        "verification": verification,
        "expirationDate": expirationDate,
        "venmoSdk": venmoSdk,
        "maskedNumber": maskedNumber,
        "expired": expired,
        "default": creditCardDefault,
    };
}

class Customer {
    Customer({
        this.createdAt,
        this.updatedAt,
        this.company,
        this.email,
        this.fax,
        this.firstName,
        this.id,
        this.lastName,
        this.phone,
        this.website,
        this.customFields,
        this.creditCards,
        this.applePayCards,
        this.androidPayCards,
        this.amexExpressCheckoutCards,
        this.coinbaseAccounts,
        this.venmoAccounts,
        this.addresses,
        this.payPalAccounts,
        this.paymentMethods,
        this.defaultPaymentMethod,
    });

    int? createdAt;
    int? updatedAt;
    dynamic company;
    dynamic email;
    dynamic fax;
    dynamic firstName;
    String? id;
    dynamic lastName;
    dynamic phone;
    dynamic website;
    CustomFields? customFields;
    List<CreditCard>? creditCards;
    List<dynamic>? applePayCards;
    List<dynamic>? androidPayCards;
    List<dynamic>? amexExpressCheckoutCards;
    List<dynamic>? coinbaseAccounts;
    List<dynamic>? venmoAccounts;
    List<Address>? addresses;
    List<dynamic>? payPalAccounts;
    List<CreditCard>? paymentMethods;
    CreditCard? defaultPaymentMethod;

    factory Customer.fromJson(Map<String, dynamic> json) => Customer(
        createdAt: json["createdAt"] == null ? null : json["createdAt"],
        updatedAt: json["updatedAt"] == null ? null : json["updatedAt"],
        company: json["company"],
        email: json["email"],
        fax: json["fax"],
        firstName: json["firstName"],
        id: json["id"],
        lastName: json["lastName"],
        phone: json["phone"],
        website: json["website"],
        customFields: CustomFields.fromJson(json["customFields"]),
        creditCards: List<CreditCard>.from(json["creditCards"].map((x) => CreditCard.fromJson(x))),
        applePayCards: List<dynamic>.from(json["applePayCards"].map((x) => x)),
        androidPayCards: List<dynamic>.from(json["androidPayCards"].map((x) => x)),
        amexExpressCheckoutCards: List<dynamic>.from(json["amexExpressCheckoutCards"].map((x) => x)),
        coinbaseAccounts: List<dynamic>.from(json["coinbaseAccounts"].map((x) => x)),
        venmoAccounts: List<dynamic>.from(json["venmoAccounts"].map((x) => x)),
        addresses: List<Address>.from(json["addresses"].map((x) => Address.fromJson(x))),
        payPalAccounts: List<dynamic>.from(json["payPalAccounts"].map((x) => x)),
        paymentMethods: List<CreditCard>.from(json["paymentMethods"].map((x) => CreditCard.fromJson(x))),
        defaultPaymentMethod: json["defaultPaymentMethod"] == null ? null : CreditCard.fromJson(json["defaultPaymentMethod"]),
    );

    Map<String, dynamic> toJson() => {
        "createdAt": createdAt == null ? null : createdAt,
        "updatedAt": updatedAt == null ? null : updatedAt,
        "company": company,
        "email": email,
        "fax": fax,
        "firstName": firstName,
        "id": id,
        "lastName": lastName,
        "phone": phone,
        "website": website,
        "customFields": customFields?.toJson(),
        "creditCards": List<dynamic>.from(creditCards!.map((x) => x.toJson())),
        "applePayCards": List<dynamic>.from(applePayCards!.map((x) => x)),
        "androidPayCards": List<dynamic>.from(androidPayCards!.map((x) => x)),
        "amexExpressCheckoutCards": List<dynamic>.from(amexExpressCheckoutCards!.map((x) => x)),
        "coinbaseAccounts": List<dynamic>.from(coinbaseAccounts!.map((x) => x)),
        "venmoAccounts": List<dynamic>.from(venmoAccounts!.map((x) => x)),
        "addresses": List<dynamic>.from(addresses!.map((x) => x.toJson())),
        "payPalAccounts": List<dynamic>.from(payPalAccounts!.map((x) => x)),
        "paymentMethods": List<dynamic>.from(paymentMethods!.map((x) => x.toJson())),
        "defaultPaymentMethod": defaultPaymentMethod == null ? null : defaultPaymentMethod?.toJson(),
    };
}


class Address {
    Address({
        this.company,
        this.countryCodeAlpha2,
        this.countryCodeAlpha3,
        this.countryCodeNumeric,
        this.countryName,
        this.createdAt,
        this.customerId,
        this.extendedAddress,
        this.firstName,
        this.id,
        this.lastName,
        this.locality,
        this.postalCode,
        this.region,
        this.streetAddress,
        this.updatedAt,
    });

    dynamic company;
    dynamic countryCodeAlpha2;
    dynamic countryCodeAlpha3;
    dynamic countryCodeNumeric;
    dynamic countryName;
    int? createdAt;
    String? customerId;
    dynamic extendedAddress;
    dynamic firstName;
    dynamic id;
    dynamic lastName;
    dynamic locality;
    String? postalCode;
    dynamic region;
    dynamic streetAddress;
    int? updatedAt;

    factory Address.fromJson(Map<String, dynamic> json) => Address(
        company: json["company"],
        countryCodeAlpha2: json["countryCodeAlpha2"],
        countryCodeAlpha3: json["countryCodeAlpha3"],
        countryCodeNumeric: json["countryCodeNumeric"],
        countryName: json["countryName"],
        createdAt: json["createdAt"] == null ? null : json["createdAt"],
        customerId: json["customerId"] == null ? null : json["customerId"],
        extendedAddress: json["extendedAddress"],
        firstName: json["firstName"],
        id: json["id"] == null ? null : json["id"],
        lastName: json["lastName"],
        locality: json["locality"],
        postalCode: json["postalCode"] == null ? null : json["postalCode"],
        region: json["region"],
        streetAddress: json["streetAddress"],
        updatedAt: json["updatedAt"] == null ? null : json["updatedAt"],
    );

    Map<String, dynamic> toJson() => {
        "company": company,
        "countryCodeAlpha2": countryCodeAlpha2,
        "countryCodeAlpha3": countryCodeAlpha3,
        "countryCodeNumeric": countryCodeNumeric,
        "countryName": countryName,
        "createdAt": createdAt == null ? null : createdAt,
        "customerId": customerId == null ? null : customerId,
        "extendedAddress": extendedAddress,
        "firstName": firstName,
        "id": id == null ? null : id,
        "lastName": lastName,
        "locality": locality,
        "postalCode": postalCode == null ? null : postalCode,
        "region": region,
        "streetAddress": streetAddress,
        "updatedAt": updatedAt == null ? null : updatedAt,
    };
}


class CustomFields {
    CustomFields();
    factory CustomFields.fromJson(Map<String, dynamic> json) => CustomFields(
    );
    Map<String, dynamic> toJson() => {
    };
}

class Descriptor {
    Descriptor({
        this.name,
        this.phone,
        this.url,
    });

    dynamic name;
    dynamic phone;
    dynamic url;

    factory Descriptor.fromJson(Map<String, dynamic> json) => Descriptor(
        name: json["name"],
        phone: json["phone"],
        url: json["url"],
    );

    Map<String, dynamic> toJson() => {
        "name": name,
        "phone": phone,
        "url": url,
    };
}

class DisbursementDetails {
    DisbursementDetails({
        this.disbursementDate,
        this.settlementCurrencyIsoCode,
        this.fundsHeld,
        this.success,
        this.settlementCurrencyExchangeRate,
        this.settlementAmount,
        this.valid,
    });

    int? disbursementDate;
    dynamic settlementCurrencyIsoCode;
    bool? fundsHeld;
    bool? success;
    int? settlementCurrencyExchangeRate;
    double? settlementAmount;
    bool? valid;

    factory DisbursementDetails.fromJson(Map<String, dynamic> json) => DisbursementDetails(
        disbursementDate: json["disbursementDate"],
        settlementCurrencyIsoCode: json["settlementCurrencyIsoCode"],
        fundsHeld: json["fundsHeld"],
        success: json["success"],
        settlementCurrencyExchangeRate: json["settlementCurrencyExchangeRate"],
        settlementAmount: json["settlementAmount"].toDouble(),
        valid: json["valid"],
    );

    Map<String, dynamic> toJson() => {
        "disbursementDate": disbursementDate,
        "settlementCurrencyIsoCode": settlementCurrencyIsoCode,
        "fundsHeld": fundsHeld,
        "success": success,
        "settlementCurrencyExchangeRate": settlementCurrencyExchangeRate,
        "settlementAmount": settlementAmount,
        "valid": valid,
    };
}



class TransactionStatusHistory {
    TransactionStatusHistory({
        this.amount,
        this.status,
        this.timestamp,
        this.source,
        this.user,
    });

    double? amount;
    dynamic status;
    int? timestamp;
    dynamic source;
    dynamic user;

    factory TransactionStatusHistory.fromJson(Map<String, dynamic> json) => TransactionStatusHistory(
        amount: json["amount"].toDouble(),
        status: json["status"],
        timestamp: json["timestamp"],
        source: json["source"],
        user: json["user"] == null ? null : json["user"],
    );

    Map<String, dynamic> toJson() => {
        "amount": amount,
        "status": status,
        "timestamp": timestamp,
        "source": source,
        "user": user == null ? null : user,
    };
}



class SubscriptionStatusHistory {
    SubscriptionStatusHistory({
        this.balance,
        this.price,
        this.timestamp,
        this.source,
        this.status,
        this.user,
    });

    int? balance;
    double? price;
    int? timestamp;
    dynamic source;
    dynamic status;
    dynamic user;

    factory SubscriptionStatusHistory.fromJson(Map<String, dynamic> json) => SubscriptionStatusHistory(
        balance: json["balance"],
        price: json["price"].toDouble(),
        timestamp: json["timestamp"],
        source: json["source"],
        status: json["status"],
        user: json["user"] == null ? null : json["user"],
    );

    Map<String, dynamic> toJson() => {
        "balance": balance,
        "price": price,
        "timestamp": timestamp,
        "source": source,
        "status": status,
        "user": user == null ? null : user,
    };
}

